package com.tarry.factory;

/**
 * 手机工厂
 */
public class PhoneFactory {
    public Phone makePhone(String phone){
        Phone p = null;
        switch (phone){
            case "MiPhone" : p = new MiPhone();break;
            case "Iphone" : p = new IPhone();break;
            default:
                System.out.println("不能制造该品牌手机：" + phone);
        }
        return p;
    }
}
